package com.blockchain.front.servlets.trading;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.blockchain.framework.service.ServiceSession;
import com.blockchain.front.service.trading.TradingManage;
import com.blockchain.util.parser.IntegerParser;

public class PjDz extends AbstractTradingServlet {
	private static final long serialVersionUID = 1L;
	@Override
	protected void processGet(HttpServletRequest request, HttpServletResponse response, ServiceSession serviceSession)
			throws Throwable {
		   processPost(request, response, serviceSession);
	}
	
	@Override
	protected void processPost(HttpServletRequest request, HttpServletResponse response, ServiceSession serviceSession)
			throws Throwable {
		TradingManage tradingManage = serviceSession.getService(TradingManage.class);
		int scid = IntegerParser.parse(request.getParameter("scid"));
		int pjid = IntegerParser.parse(request.getParameter("pjid"));
		int type = IntegerParser.parse(request.getParameter("type"));
		tradingManage.dz(pjid, type);
		String url=getController().getViewURI(request,CommentMarket.class)+"?id="+scid;
		sendRedirect(request, response,url);
	}
}
